Draw Context Data Structure
QuickDraw 3D defines the draw context data structure to maintain information that is common to all the supported draw contexts. The draw context data structure is defined by theTQ3DrawContextData
data type.
typedef struct TQ3DrawContextData { TQ3DrawContextClearImageMethod clearImageMethod; TQ3ColorARGB clearImageColor; TQ3Area pane; TQ3Boolean paneState; TQ3Bitmap mask; TQ3Boolean maskState; TQ3Boolean doubleBufferState; } TQ3DrawContextData;
Field Description
clearImageMethod
- A constant that indicates how the drawing destination should be cleared. You can use these constants to specify a method to clear the image.
typedef enum TQ3DrawContextClearImageMethod { kQ3ClearMethodNone, kQ3ClearMethodWithColor } TQ3DrawContextClearImageMethod;
- The constant
kQ3ClearMethodNone
indicates that the drawing destination should not be cleared. The exact behavior whenQ3View_StartRendering
is called is renderer-dependent. For example, some renderers expect to redraw every pixel in the drawing destination. By specifyingkQ3ClearMethodNone
, you allow those renderers to apply optimizations during rendering. The constantkQ3ClearMethodWithColor
indicates that the drawing destination should be cleared with the color specified in theclearImageColor
field.clearImageColor
- The color to be used when clearing the drawing destination with a color. This field is ignored unless the value in the
clearImageMethod
field iskQ3ClearMethodWithColor
.pane
- The rectangular area (specified in window coordinates) in the drawing destination within which all drawing occurs. If the output pane is smaller than the window's port rectangle, the image is scaled (not clipped) to fit into the pane.
paneState
- A Boolean value that determines whether the area specified in the
pane
field is to be used (kQ3True
) or is to be ignored (kQ3False
). Set this field tokQ3False
to use the entire window as the output pane. If this field is set tokQ3True
, thepane
field must contain a valid area.mask
- A bitmap that is used to mask out certain portions of the drawing destination. Each bit in the bitmap corresponds to a pixel in the drawing area. If a bit is set, the corresponding pixel is drawn; if a bit is clear, the corresponding pixel is not drawn. If the value in this field is
NULL
, the entire window is used as the clipping region.maskState
- A Boolean value that determines whether the mask specified in the
mask
field is to be used (kQ3True
) or is to be ignored (kQ3False
). If this field is set tokQ3True
, themask
field must contain a valid bitmap.doubleBufferState
- A Boolean value that determines whether double buffering is to used for the drawing destination (
kQ3True
) or not (kQ3False
). When double buffering is enabled, the back buffer is the active buffer.